package com.chuangmei.com.arindoorlocationsystem.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.view.Window;
import android.widget.ImageView;

import com.chuangmei.com.arindoorlocationsystem.R;


/**
 * 项目名称：MyArcGISMap
 * 类描述：等待加载，地球动画监听
 * 创建人：Administrator
 * 创建时间：2017/3/18 0018 下午 5:31
 * 修改人：Administrator
 * 修改时间：2017/3/18 0018 下午 5:31
 * 修改备注：
 */


public class ProgressDialog extends Dialog {


    private final Context context;

    public ProgressDialog(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_animatio);
        this.setCancelable(false);
        this.setCanceledOnTouchOutside(false);
        this.initAnim();
    }

    private void initAnim() {
        ImageView mIV_rocketImage = (ImageView) findViewById(R.id.mIV_rocketImage);
//        if (CommonUtils.getScreenSizeOfDevice2((Activity) context) < 7.5) {
//            mIV_rocketImage.setMinimumWidth(100);
//            mIV_rocketImage.setMinimumHeight(100);
//        }
        AnimationDrawable animationDrawable = (AnimationDrawable) mIV_rocketImage.getBackground();
        animationDrawable.start();
    }

    @Override
    public void setOnDismissListener(OnDismissListener listener) {
        super.setOnDismissListener(listener);
    }
}
